<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>simple-electron</title>
</head>
<body>
<h1>调用 C++ 模块</h1>
<button id="add">调用 add(1, 2)</button>
<button id="multiply">调用 multiply(2, 3)</button>
<p id="result"></p>

<script>
  document.getElementById('add').onclick = async () => {
    const result = await window.api.add(1, 2);
    document.getElementById('result').textContent = `Add Result: ${result}`;
  };

  document.getElementById('multiply').onclick = async () => {
    const result = await window.api.multiply(2, 3);
    document.getElementById('result').textContent = `Multiply Result: ${result}`;
  };
</script>
</body>
</html>